1. Field of the invention
The present invention relates to generating executable code from a program written in a high-level programming language and, in particular, to generating executable code for a vector processor from a program written in a high-level language. The present invention also relates to generating parallel executable code from a program written in a high-level language.
2. Description of Related Art
High-level languages such as ANSI C and C++ provide only limited support for vector operations. The C language is described in "The C Programming Language" by Brian W. Kernighan and Dennis M. Ritchie (Englewod Cliffs, N.J.: Prentice-Hall, Inc. 1978) and the C++ language is described in "Programming in C++" by Stephen C. Dewhurst and Kathy T. Stark (Englewood Cliffs, N.J.: Prentice-Hall, Inc. 1989), which are herein incorporated by reference in their entirety. In C/C++, for example, vectors can be accessed at the level of their individual elements. That is, to add a vector.sub.-- a to a vector.sub.-- b and store the result in a vector.sub.-- c a programmer would write a loop to iterate through each element of vector.sub.-- a and vector.sub.-- b and store the result in the corresponding element of vector.sub.-- c. The C/C++ code for this operation could be:
int i, vector.sub.-- a[10], vector.sub.-- b[10], vector.sub.-- c[10]; PA1 for(i=0, i&lt;10, i++) PA1 int vector.sub.-- a[10]={10, 8, 3, 5, 7, 23, 12, 1, 0, 9};
{vector.sub.-- c[i]=vector.sub.-- a[i]+vector.sub.-- b[i];}
An exception to this rule is that static vector arrays may be initialized in a single assignment operation in the declaration, as shown below:
Vector processors, on the other hand, support a variety of instructions that operate on an entire vector as a single element, rather than as a collection of elements. To generate such instructions, a compiler for a program performing vector operations would have to recognize vector operations from code such as the above example given for the addition of vector.sub.-- a and vector.sub.-- b. There is thus a need for a high-level language to facilitate recognition of vector operations by a compiler.
It is also desirable to provide a high level interface to allow the programmer to control communication between two processors.